﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Touch2Like.DAL;
using Touch2Like.Model;
using Touch2Like.SharedLibrary;

namespace Touch2Like.Web.Product
{
    public partial class Detail : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                if (!string.IsNullOrEmpty(Request["ID"]))
                {
                    ProductDAL product = new ProductDAL();
                    ProductInfo productInfo = product.GetProductsBySKU(Convert.ToInt32(Utility.Encryption.Decrypt(Request["ID"])));

                    if (productInfo != null)
                    {
                        lb_GoodsNo.Text = productInfo.SKU.ToString();
                        lb_GoodsName.Text = productInfo.Name;
                        lb_GoodsName1.Text = productInfo.Name;
                        lb_GoodsDes.Text = productInfo.Headline;
                        lb_GoodsPrice.Text = productInfo.Price.ToString();
                        lb_Description.Text = productInfo.Description;
                        lb_Parameter.Text = productInfo.Technical;
                        proCon_pics_midSize.Src = productInfo.PictureLocation;

                        ClientScript.RegisterStartupScript(this.GetType(), "init", "<script>maxCount='" + productInfo.Quantity + "';</script>");
                    }
                }
            }
        }
    }
}